package com.example.demo.service;

import com.example.demo.dao.PersonRepository;
import com.example.demo.entity.Person;
import com.example.demo.entity.User;
import com.example.demo.entity.View;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ViewService {
    @Autowired
    PersonRepository personRepository;

    public List<Person> test(Long card){

        List<User> viewu = personRepository.findViewu(card);
        System.out.println(viewu);
        String community = viewu.get(0).getCommunity();
        List<Person> viewp = personRepository.findViewp(community);
        return viewp;
    }

}
